# coding: UTF-8
# @Date    ：2024/10/14 17:36 
# @File    : app.py
# :Author:  fum
from flask import Flask


def create_app() -> Flask:
    """创建服务"""
    _app = Flask(__name__)
    initialize_base_system(_app)
    return _app


def initialize_base_system(_app: Flask):
    """
    初始化基础系统
    """
    from configs import ConfigManager
    ConfigManager.init_config(_app)
    # 执行下面之前必须先初始化配置
    from extensions import init_extensions
    from controllers import init_controllers
    init_extensions(_app)
    init_controllers(_app)


app = create_app()
